var app = getApp();

Page({
    data: {
        siteInfo: app.siteInfo,
        imgUrls: [
            'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
            'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
            'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'
        ],
        indicatorDots: false,
        autoplay: false,
        interval: 5000,
        duration: 1000
    },

    intervalChange: function (e) {
        this.setData({
            interval: e.detail.value
        })
    },
    durationChange: function (e) {
        this.setData({
            duration: e.detail.value
        })
    },
    onLoad: function () {
        var that = this;
        app.util.footer(that);
    },
    onReady: function (e) {

    },
    onShow: function (e) {

    },
    onHidden: function (e) {

    },
    onUpload: function (e) {

    },
    /**
     * 底部导航跳转
     */
    footerRedirect: function (e) {
        var type = e.target.dataset.type;
        if (type == 2) {
            var jumpData = e.target.dataset.jumpdata;
            //跳转到小程序
            wx.navigateToMiniProgram({
                appId: jumpData.appid,
                path: jumpData.url,
                extraData: jumpData.extra_data,
                envVersion: jumpData.env_version,
                success(res) {
                    // 打开成功
                },
                fail(res) {

                }
            })
            return;
        } else {
            wx.redirectTo({
                url: e.target.dataset.pagepath,
            });
        }
    }
});